<style scoped>
.inform_item{
  margin: 10px;
}
.contentmore:hover{
  color: #337ab7;
  text-decoration:underline;
}
.mimachangebox >>> .el-input__inner {
  width: 270px;
}
.iconfont{
  font-size: 23px;
  margin-top: 3px;
}
.btn{
  display: inline-block;
  margin-left: 20px;
  margin-top: 3px;
  padding: 6px 20px;
  border-radius: 4px;
  background-color: #3C7EEE;
  color: #fff;
  cursor: pointer;
}
.input{
  width: 200px;
  border: solid 1px #e8ecf0;
  border-radius: 5px;
  margin-left: 14px;
  padding: 7px;
}
.change{
  color: #3C7EEE;
  font-size:16px;
  cursor: pointer;
  margin-left: 30px;
}
.subtitle{
  width: 81px;
  color: #8997ab;
  text-align: right;
  font-size: 16px;
}
.avatar{
  width: 120px;
  height: 120px;
  border-radius: 50%;
}
.content_nav{
  height: 60px;
  width: 100%;
  padding: 0 18px;
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid #e8ecf0;;
}
.content_nav_item{
  height: 60px;
  color: #333;
  display: flex;
  margin-right: 20px;
  align-items:center;
  cursor: pointer;
  font-size: 16px;
  margin-right: 42px;
  opacity: 0.4;
}
.item_active{
  opacity: 1;
  border-bottom: 4px solid #3c7eee;
}
.contentbox{
  margin: 20px 20px 0px 20px;
  max-width:85%;
  min-width: calc(100% - 250px);
  background: #fff;
  box-shadow: 0px 1px 4px 0px #d5dae4;
  padding: 0px 0 20px;
  border-radius: 1px;
  text-align: center;
  display: flex;
  flex-direction:column;
}
#leftnavitem{
  height: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#leftnavitem:hover{
  color: #3C7EEE;
  background:  #fafafa;;
}
.leftnavitem_active{
  color: white;
  background: #3C7EEE;
}
.table{
    width: calc(100% - 40px);
    background: rgb(255, 255, 255);
    /* box-shadow: rgb(213, 218, 228) 0px 1px 4px 0px; */
    padding: 28px 0px 20px;
    margin:20px 20px 0px 20px;
    /* border-radius: 1px; */
    text-align: center;
}
.personinform {
  max-width: 15%;
  min-width: 250px;
  display:flex;
  flex-direction:column;
  height: 300px;
  background: #fff;
  margin-bottom: 10px;
  box-shadow: 0px 1px 4px 0px #d5dae4;
  padding: 28px 0 20px;
  border-radius: 1px;
  align-items:center;
  margin: 20px 20px 0px 20px;
}
.portrait {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  vertical-align: baseline;
}
#personal-Simulated-trading {
  height: 50px;
  width: 100%;
}

span {
  font-size: 20px;
}

#personal-Simulated-trading a,
#personal-strategy-title a {
  float: right;
}

h4 {
  display: block;
  margin-block-start: 1.33em;
  margin-block-end: 1.33em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
  margin-top: 0px;
}

div {
  display: block;
}

.item-text {
  color: #8997ab;
  font-size: 12px;
  font-family: PingFangSC-Regular;
}

.Simulated-tradingcontent {
  width: calc((100% - 46px) / 3);
  margin-right: 15px;
  border-radius: 2px;
  border: 1px solid #e8ecf0;
  padding: 20px 0 21px;
  box-sizing: border-box;
}

.trading-item {
  width: calc(100% / 3);
}

.Simulated-tradingcontentbox {
  width: 100%;
  padding: 26px 0px 28px;
  height: 207px;
  display:flex;
  flex-direction: row;
  justify-content:space-between;
  /* border: 1px solid #ddd; */
}

.trading-title-text {
  margin-left: 26px;
}

.personal-strategy {
  background: rgb(255, 255, 255);
  box-shadow: rgb(213, 218, 228) 0px 1px 4px 0px;
  border-radius: 1px;
  padding: 28px 0px 20px;
  margin: 20px 20px 20px;
}

.form-control {
  width: 25%;
}
.changename {
  display: inline;
  margin-left: 5px;
}

.plabel {
  width: 150px;
  padding-top: 6px;
  font-size: 18px;
}

.personinformdiv {
  width: 100%;
  height: 50px;
}

.divinline {
  display: inline;
}
#changenamediv {
  position: absolute;
  left: 150px;
}
.portrait {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  vertical-align: baseline;
}
.p_f12 {
  font-size:16px;
  font-weight: 500;
  display: block;
  color: #61676e;
  text-align: center;
}
.title_p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #323f50;
  font-weight: 600;
  font-size: 20px;
  padding: 20px 30px;
}
.title_p a {
  color: #323f50;
}
.items {
  width: calc(25% - 2px);
  font-size: 12px;
  border-right: 1px solid #e8ecf0;
}
.contentmore{
  cursor: pointer;
}
.contentmore:hover{
  color: #337ab7;
  text-decoration:underline;
}
.portrait {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  vertical-align: baseline;
}
.rank{
  width: 80px;
  height: 60px;
  color:#fff;
  font-size:20px;
  font-weight:600;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* .schart {
  background-color: #ffffff;
  box-shadow: 1px 1px 3px 0 rgba(193, 193, 193, 0.55)
} */
</style>
<template>
  <div style="padding-top:85px;"> 
    <div style="width:80%;display:flex;justify-content:center;margin-left: 10%;">
      <div style="display:flex;flex-direction: row;width:100%;">
        <div style="display:flex;flex-direction: column;width:100%;">
          <!-- 个人信息头像框 -->
          <div class="personinform">
            <div style="width: 84px;height: 84px;">
              <img class="portrait" style="width:100%;height:100%" :src="imageUrl" />
            </div>
            <div style="font-size: 16px;color: #333;line-height: 22px;margin: 13px 0px 18px 0px;font-family: PingFangSC-Medium;font-weight: 500;cursor: pointer;">{{userinfo.name}}</div>
            <div style="display:flex;flex-direction:row;">
              <div style="width:80px;display:flex;flex-direction:column;align-items:center;">
                <div>关注</div>
                <div></div>
              </div>
              <div style="width:80px;display:flex;flex-direction:column;align-items:center;">
                <div>被关注</div>
                <div></div>
              </div>
            </div>
          </div>
          <div class="personinform" style="height:500px">
            <div @click="menuflag=1" id="leftnavitem" :class="{leftnavitem_active:menuflag === 1} ">我的主页</div>
            <div @click="menuflag=2" id="leftnavitem" :class="{leftnavitem_active:menuflag === 2} ">我的点赞</div>
            <div @click="menuflag=3" id="leftnavitem" :class="{leftnavitem_active:menuflag === 3} ">我的文章</div>
            <div @click="menuflag=4" id="leftnavitem" :class="{leftnavitem_active:menuflag === 4} ">账号设置</div>
            <!-- <div @click="menuflag=5" id="leftnavitem" :class="{leftnavitem_active:menuflag === 5} ">我的策略</div>
            <div @click="menuflag=5" id="leftnavitem" :class="{leftnavitem_active:menuflag === 5} ">我的模拟交易</div> -->
          </div>
        </div>
        <!-- 内容-我的主页 -->
        <div style="max-width:85%;min-width: calc(100% - 250px);display:flex;flex-direction:column;" v-if="menuflag===1">
        <div v-if="permission.indexOf('B6') != -1" class="personal-strategy">
              <!-- 标题 -->
              <div id="personal-strategy-title" style="border-bottom: 1px solid #e8ecf0;display:flex;justify-content: flex-start;padding-left: 20px;">
                <h4 style="color: #333;font-size:18px;font-weight: 700;line-height: 22px;margin-left:20px;">我的策略</h4>
              </div>
              <!-- 策略显示 -->
              <div>
                <el-scrollbar style="height: 260px;">
                <table id="strategyTable" class="table table-hover pointer">
                <thead>
                  <tr>
                    <td width="15%"  align="center" style="padding-left:20px;">序号</td>
                    <td width="25%" align="left" style="padding-left:20px;">策略名称</td>
                    <td width="10%" align="center">分类</td>
                    <td width="30%" align="center">最近更新时间</td>
                  </tr>
                </thead>
                
                <tbody >
                  <tr v-for="item in StrategyList" :key="item.id">
                    <td width="15%"  align="center" style="padding-left:20px;">{{item.id}}</td>
                    <td width="25%" align="left" style="padding-left:20px;" class="contentmore" @click="strategydetail(item.id)">
                      <img style="width: 20px;height: 20px;" src="./../../../static/image/03.png" />
                      <span style="font-size:14px;">{{item.strategyname}}</span>
                    </td>
                    <td width="30%" align="center">
                      <img style="width: 50px;height: 25px;" src="./../../../static/image/code.png" />
                    </td>
                    <td align="center" style="font-size:14px;">{{item.uploadtime}}</td>
                  </tr>
                </tbody>
                
              </table>
              </el-scrollbar>
              <div  v-if="StrategyList == null" style="width:100%;text-align:center;margin:30px 10px;font-size:20px;font-weight:600">当前无策略</div>
              </div>
          </div>
          <div style="margin: 20px 20px 0px 20px;background: #fff;margin-bottom: 10px;box-shadow: 0px 1px 4px 0px #d5dae4;padding: 28px 0 20px;border-radius: 1px;text-align: center;">
            <div style="border-bottom: 1px solid #e8ecf0;display:flex;justify-content: flex-start;padding-left: 20px;">
              <div style="font-size:18px;font-weight:600;margin-bottom:20px;">精选策略</div>
            </div>
            <div>
              <el-scrollbar style="height: 330px;">
              <div style="display: flex;flex-direction:column;width: 100%;justify-content: center;">
              <div  v-for="item in selectionStrategyData" :key="item.testrecord.id"  class="schart" style="margin: 20px;width:calc(100% - 40px);border-bottom:1px soild #dee2e6 ">
                <div style="display:flex;flex-direction:column;">
                  <div style="height:70px;display:flex;flex-direction:row;justify-content:space-between;">
                    <div style="display:flex;flex-direction:row;margin-left:40px;">
                      <div v-if="item.rank === 1" class="rank" style="background:red;">{{item.rank}}</div>
                      <div v-if="item.rank === 2" class="rank" style="background:#fb8341;">{{item.rank}}</div>
                      <div v-if="item.rank === 3" class="rank" style="background:#e8c55b;">{{item.rank}}</div>
                      <div v-if="item.rank > 3" class="rank" style="background:#a8bedc;">{{item.rank}}</div>
                      <div class="title_p contentmore" @click="gotoStrategydetail(item.testrecord.id,item.testrecord.strategyid)">{{item.strategyName}}</div>
                    </div>
                    <div  style="display:flex;flex-direction:row;margin-right:40px;padding:20px 20px;align-items:center;">
                      <img class="portrait" style="margin-right:10px;" :src="item.userInfo.head"/>
                      <div>{{item.userInfo.name}}</div>
                    </div>
                  </div>
                  <div style="display:flex;flex-direction:row;">
                    <div class="items">
                      <p class="p_f12">策略收益</p>
                      <p class="p_f12" style="text-align: center;font-size:20px;color:black;margin-left:10px">{{item.testrecord.profit}}</p>
                    </div>
                    <div class="items">
                      <p class="p_f12">实际收益</p>
                      <p class="p_f12" style="text-align: center;font-size:20px;color:black;margin-left:10px">{{item.testrecord.standardprofit}}</p>
                    </div>
                    <div class="items" style="border: none;width: calc(40% - 2px);">
                      <p class="p_f12">回测时间</p>
                      <p class="p_f12"  style="font-size:20px;color:black;margin-left:10px">{{item.testrecord.starttime}} - {{item.testrecord.endtime}}</p>
                    </div>
                  </div>
                </div>
              </div>
              <!-- <div class="Simulated-tradingcontentbox">
                <div class="Simulated-tradingcontent" style="margin-left:15px;">
                  <div style="font-size:16px;font-weight:500;margin-bottom:20px;">模拟交易名称</div>
                  <div style="display:flex;flex-direction: row;justify-content:space-around;align-items:center;">
                    <div class="trading-item">
                      <p class="item-text">累计收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">今日收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">最大回撤</p>
                      <p>--</p>
                    </div>
                  </div>
                </div>

                <div class="Simulated-tradingcontent" style="margin-left:15px;">
                  <div style="font-size:16px;font-weight:500;margin-bottom:20px;">模拟交易名称</div>
                  <div style="display:flex;flex-direction: row;justify-content:space-around;align-items:center;">
                    <div class="trading-item">
                      <p class="item-text">累计收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">今日收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">最大回撤</p>
                      <p>--</p>
                    </div>
                  </div>
                </div>

                <div class="Simulated-tradingcontent" style="margin-left:15px;">
                  <div style="font-size:16px;font-weight:500;margin-bottom:20px;">模拟交易名称</div>
                  <div style="display:flex;flex-direction: row;justify-content:space-around;align-items:center;">
                    <div class="trading-item">
                      <p class="item-text">累计收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">今日收益</p>
                      <p>--</p>
                    </div>
                    <div class="trading-item">
                      <p class="item-text">最大回撤</p>
                      <p>--</p>
                    </div>
                  </div>
                </div> -->
              </div>
              </el-scrollbar>
          </div>
        </div>
        </div>
        

        <!-- 内容-我的点赞 -->
        <div class="contentbox" v-if="menuflag===2">
          <div class="content_nav">
            <div style="font-weight:600"  class="content_nav_item item_active">我的点赞</div>
          </div>
          <div style="width:100%;display:flex;flex-direction:column;padding:20px 20px;">
            <el-scrollbar style="height: 700px;">
            <div v-for="(item,index) in LikeList" :key="index" style="width: calc(100% - 40px);margin:0px 20px;display:flex;flex-direction: row; justify-content:space-around;align-items:center;border-bottom: 1px solid #e8ecf0;">
              <div style="width:100%;display:flex;flex-direction: column;">
                <div class="pointer" style="font-size:18px;font-weight:700;margin:20px;display:flex;justify-content: flex-start;" @click="gotoArticle(item.id)">{{item.author}}</div>
                <div style="display:flex;flex-direction: row;">
                  <!-- 点赞 -->
                  <div class="inform_item pointer">
                    <i class="iconfont icon-collection" style="margin-right:5px;color:red;"></i>
                    <span style="font-size: 18px;">{{item.vote}}</span>
                  </div>
                  <!-- 点击率 -->
                  <div class="inform_item pointer">
                    <i class="iconfont icon-eye-o" style="margin-right:5px;"></i>
                    <span style="font-size: 18px;">{{item.reading_volume}}</span>
                  </div>
                  <!-- <div class="inform_item pointer" style="margin-right:5px;">
                    <i class="iconfont icon-message"></i>
                    <span style="font-size: 18px;"></span>
                  </div> -->
                </div>
              </div>
              <div style="display:flex;flex-direction:column;width:16%;justify-content:center;align-items:center">
                <div style="display:flex;flex-direction:row;align-items:center">
                  <div style="width: 40px;height: 40px;margin-right:15px">
                    <img :src="item.img" class="portrait"/>
                  </div>
                  <div>{{item.author}}</div>
                </div>
                
                <div>{{item.create_time}}</div>
              </div>
            </div>
            </el-scrollbar>
          </div>
        </div>

        <!-- 内容-我的文章 -->
        <div class="contentbox" v-if="menuflag===3">
          <div class="content_nav">
            <div style="font-weight:600"  class="content_nav_item item_active">我的文章</div>
          </div>
          <div style="width:100%;display:flex;flex-direction:column;padding:20px 20px;">
            <el-scrollbar style="height: 700px;">
            <div v-for="item in ArticleList" :key="item.id" style="width: calc(100% - 40px);margin:0px 20px;display:flex;flex-direction: row; justify-content:space-around;align-items:center;border-bottom: 1px solid #e8ecf0;">
              <div style="width:100%;display:flex;flex-direction: column;">
                <div class="pointer" style="font-size:18px;font-weight:700;margin:20px;display:flex;justify-content: flex-start;" @click="gotoArticle(item.id)">{{item.articleName}}</div>
                <div style="display:flex;flex-direction: row;">
                  <!-- 点赞 -->
                  <div class="inform_item pointer">
                    <i class="iconfont icon-collection" style="margin-right:5px;"></i>
                    <span style="font-size: 18px;">{{item.vote}}</span>
                  </div>
                  <!-- 点击率 -->
                  <div class="inform_item pointer">
                    <i class="iconfont icon-eye-o" style="margin-right:5px;"></i>
                    <span style="font-size: 18px;">{{item.readingVolume}}</span>
                  </div>
                  <div class="inform_item pointer">
                    <i class="iconfont icon-message" style="margin-right:5px;"></i>
                    <span style="font-size: 18px;"></span>
                  </div>
                </div>
              </div>
              <div style="width:15%">{{item.createTime}}</div>
              <div @click="deletearticle(item.id)"><i class="iconfont icon-delete" ></i></div>
            </div>
            </el-scrollbar>
          </div>
        </div>

        <!-- 内容-账号设置 -->
        <div class="contentbox" v-if="menuflag===4">
          <div class="content_nav">
            <div style="font-weight:600" @click="content1nav = 1" :class="{item_active:content1nav === 1}" class="content_nav_item">个人资料</div>
            <div style="font-weight:600" @click="content1nav = 2" :class="{item_active:content1nav === 2}" class="content_nav_item">账号安全</div>
          </div>
          <div v-if="content1nav === 1" style="width:100%;display:flex;flex-direction:column;">
            <div style="width:100%;display:flex;justify-content:center;padding:61px 0 50px;">
              <el-upload
                v-if="permission.indexOf('D3') != -1"
                class="avatar-uploader"
                action="string"
                accept="image/jpeg,image/jpg,image/png,image/PNG,image/JPG"
                :show-file-list="false"
                :before-upload="onBeforeUploadImage"
                :http-request="upload">
                <!-- :before-upload="beforeAvatarUpload" -->
                <img v-if="imageUrl" :src="imageUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div style="display:flex;justify-content:flex-start;padding-left:30px;flex-direction:column;">
              <div style="font-size:18px;font-weight:600;width:100px;margin-top:20px;">基本信息</div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;margin-top:14px;">
                <div class="subtitle">昵称</div>
                <div v-if="usernamechangeflag === 0" style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" @mouseenter="usernamechange = 1" @mouseleave="usernamechange = 0">
                  <div  style="color:#333;margin-left:30px" >{{userinfo.name}}</div>
                  <div v-if="usernamechange === 1" class="change" @click="usernamechangeflag = 1;" >修改</div>
                </div>
                <div v-else style="display:flex;flex-direction:row;align-items:center;">
                  <input class="input" type="text" v-model="username" />
                  <input type="button" value="确定" class="btn btn-primary" @click="changename()" />
                  <input type="button" value="取消" style="background:#fff;color:#3C7EEE;" @click="usernamechangeflag = 0;" class="btn btn-primary" />
                </div>
                
              </div>
              <!-- <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">性别</div>
                <div class="subtitle" style="color:#333"></div>
              </div> -->
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">邮箱</div>
                <div style="color:#333;margin-left:30px">{{userinfo.email}}</div>
                <!-- <div v-if="userinfo !== ''">
                  <div v-if="emailchangeflag === 0" style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" @mouseenter="emailchange = 1" @mouseleave="emailchange = 0">
                    <div style="color:#333;margin-left:30px">{{userinfo.email}}</div>
                    <div v-if="emailchange === 1" class="change" @click="emailchangeflag = 1;" >修改</div>
                  </div>
                  <div v-else style="display:flex;flex-direction:row;align-items:center;">
                    <input class="input" type="text" v-model="email" />
                    <input type="button" value="确定" class="btn btn-primary" @click="changeemail()" />
                    <input type="button" value="取消" style="background:#fff;color:#3C7EEE;" @click="emailchangeflag = 0;" class="btn btn-primary" />
                  </div>
                </div>
                <div v-else>
                  <div v-if="emailchangeflag === 0" style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" >
                    <i class="iconfont icon-addto" style="color: #3C7EEE;font-size:22px;cursor: pointer;margin-left:30px"></i>
                    <div class="change" style="margin-left:5px" @click="emailchangeflag = 1;" >添加</div>
                  </div>
                  <div v-else style="display:flex;flex-direction:row;align-items:center;">
                    <input class="input" type="text" v-model="email" />
                    <input type="button" value="确定" class="btn btn-primary" @click="changeemail()" />
                    <input type="button" value="取消" style="background:#fff;color:#3C7EEE;" @click="emailchangeflag = 0;" class="btn btn-primary" />
                  </div>
                </div> -->
              </div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">手机号</div>
                <div class="subtitle" style="color:#333;margin-left:30px">{{userinfo.phone}}</div>
              </div>
              <!-- <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">个性签名</div>
                <div class="subtitle" style="color:#333"></div>
              </div> -->
            </div>
          </div>

          <div v-if="content1nav === 2" style="width:100%;display:flex;flex-direction:column;">
            <div style="display:flex;justify-content:flex-start;padding-left:30px;flex-direction:column;">
              <div style="font-size:18px;font-weight:600;width:100px;margin-top:20px;">基本信息</div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;margin-top:14px;">
                <div class="subtitle">手机号</div>
                <!-- <div class="subtitle" style="color:#333">{{userinfo.phone}}</div> -->
                <div style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" @mouseenter="userphonechange = 1" @mouseleave="userphonechange = 0">
                  <div  class="subtitle" style="color:#333;margin-left: 30px;" >{{userinfo.phone}}</div>
                  <div v-if="userphonechange === 1 && permission.indexOf('D2') != -1" class="change" @click="userphonechangeflag = true" >修改</div>
                </div>
                <!-- <div v-else style="display:flex;flex-direction:row;align-items:center;">
                  <input class="input" type="text" v-model="userinfo.phone" />
                  <input type="button" value="确定" class="btn btn-primary" />
                  <input type="button" value="取消" style="background:#fff;color:#3C7EEE;" @click="userphonechangeflag = 0" class="btn btn-primary" />
                </div> -->
              </div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;margin-top:14px;">
                <div class="subtitle">邮箱</div>
                <!-- <div class="subtitle" style="color:#333">{{userinfo.phone}}</div> -->
                <div v-if="userinfo.email == null" style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" @mouseenter="useremailchange = 1" @mouseleave="useremailchange = 0">
                  <div  class="change" @click="useremailaddflag = true" >添加邮箱</div>
                </div>
                <div v-else style="display:flex;flex-direction:row;align-items:center;padding-right:30px;" @mouseenter="useremailchange = 1" @mouseleave="useremailchange = 0">
                  <div  class="subtitle" style="width:150px;color:#333;margin-left: 30px;" >{{userinfo.email}}</div>
                  <div v-if="useremailchange === 1" class="change" @click="useremailchangeflag = true" >修改</div>
                </div>
                <!-- <div v-else style="display:flex;flex-direction:row;align-items:center;">
                  <input class="input" type="text" v-model="userinfo.phone" />
                  <input type="button" value="确定" class="btn btn-primary" />
                  <input type="button" value="取消" style="background:#fff;color:#3C7EEE;" @click="userphonechangeflag = 0" class="btn btn-primary" />
                </div> -->
              </div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">登陆密码</div>
                <div class="change" style="margin-left:30px" @click="phonemimachangeflage = true">手机验证</div>
                <div class="change" style="margin-left:30px" @click="emailmimachangeflage = true">邮箱修改</div>
              </div>
              <div style="font-size:18px;font-weight:600;width:100px;margin-top:20px;">第三方账号</div>
              <div style="display:flex;flex-direction:row;padding:20px;align-items:center;">
                <div class="subtitle">开发中</div>
                <!-- <div class="subtitle" style="color:#333"></div> -->
              </div>
            </div>
          </div>
        </div>
        
      </div>
      <div>
      <div class="mimachangebox">
        <el-dialog title="手机验证修改密码" width="600px" :visible.sync="phonemimachangeflage" style="border-radius: 4px;" center>
          <div style="display:flex;justify-content:center;flex-direction:column">
          <!-- <div style="width:540px;height: 1px;background-color: #32c5d2;margin-bottom:20px;"></div> -->
          <el-form  :model="form">
            <el-form-item label="手机号" label-width="160px">
              <el-input type="text" v-model="userinfo.phone" :disabled="true" placeholder="请输入原手机号" clearable></el-input>
            </el-form-item>
            <el-form-item label="验证码" label-width="160px">
              <div style="display:flex;flex-direction: row">
                <input type="text" placeholder=" 请输入验证码" v-model="form.code" v-validate="'required'" name="验证码" style="width: 122px;height:40px;color: #606266;border-radius: 4px;padding-right: 30px;border: 1px solid #DCDFE6;" />
                <input class="btn btn-primary" @click="getphonecode" value=" 获取短信验证码" style="width: 142px;cursor: pointer;margin:0px 0px 0px 6px;padding:0px"/>
                <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('验证码') }}</span>
              </div>
            </el-form-item>
            <el-form-item label="密码" label-width="160px">
              <el-input type="password" v-model="form.password" placeholder="请输入修改密码" name="密码" ref="password" v-validate="'required|min:8'" clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('密码') }}</span>
            </el-form-item>
            <el-form-item label="重复密码" label-width="160px">
              <el-input type="password" v-model="form.password2" placeholder="请输入重复输入密码" name="重复密码" v-validate="'required|confirmed:password'" clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('重复密码') }}</span>
            </el-form-item>
          </el-form>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" style="background-color:#3C7EEE;width:120px;border:none;" @click="phonemimachangeflage = false;phonechangemima()">确 定</el-button>
            <el-button @click="phonemimachangeflage = false;form.password='';form.password2='';form.code=''" style="background-color:#cccccc;color:#ffffff;width:120px;">取 消</el-button>
          </div>
        </el-dialog>
      </div>
      <div class="mimachangebox">
        <el-dialog title="邮箱验证修改密码" width="600px" :visible.sync="emailmimachangeflage" style="border-radius: 4px;" center>
          <div style="display:flex;justify-content:center;flex-direction:column">
          <!-- <div style="width:540px;height: 1px;background-color: #32c5d2;margin-bottom:20px;"></div> -->
          <el-form  :model="cpass">
            <el-form-item label="邮箱号" label-width="160px">
              <el-input type="text" v-model="userinfo.email" :disabled="true"  clearable></el-input>
            </el-form-item>
            <el-form-item label="验证码" label-width="160px">
              <div style="display:flex;flex-direction: row">
                <input type="text" placeholder=" 请输入验证码" v-validate="'required'" name="验证码" v-model="cpass.code" style="width: 122px;height:40px;color: #606266;border-radius: 4px;padding-right: 30px;border: 1px solid #DCDFE6;" />
                <input class="btn btn-primary" @click="getemailyzcode"  value=" 获取邮箱验证码" style="width: 142px;cursor: pointer;margin:0px 0px 0px 6px;padding:0px"/>
              </div>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('验证码') }}</span>
            </el-form-item>
            <el-form-item label="密码" label-width="160px">
              <el-input type="password" name="密码" v-validate="'required|min:8'" v-model="cpass.password" ref="password" placeholder="请输入修改密码" clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('密码') }}</span>
            </el-form-item>
            <el-form-item label="重复密码" label-width="160px">
              <el-input type="password" v-model="cpass.password2" name="重复密码" v-validate="'required|confirmed:password'" placeholder="请输入重复输入密码" clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('重复密码') }}</span>
            </el-form-item>
          </el-form>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" style="background-color:#3C7EEE;width:120px;border:none;" @click="emailmimachangeflage = false;emailchangemima()">确 定</el-button>
            <el-button @click="emailmimachangeflage = false;cpass.code='';cpass.password2='';cpass.passowrd=''" style="background-color:#cccccc;color:#ffffff;width:120px;">取 消</el-button>
          </div>
        </el-dialog>
      </div>
      <div class="mimachangebox">
        <el-dialog title="修改手机号" width="600px" :visible.sync="userphonechangeflag" style="border-radius: 4px;" center>
          <div style="display:flex;justify-content:center;flex-direction:column">
          <!-- <div style="width:540px;height: 1px;background-color: #32c5d2;margin-bottom:20px;"></div> -->
          <el-form :model="cphone">
            <el-form-item label="手机号" label-width="160px">
              <el-input type="text" v-model="userinfo.phone" :disabled="true" placeholder="请输入原手机号" clearable></el-input>
            </el-form-item>
            <el-form-item label="验证码" label-width="160px">
              <div style="display:flex;flex-direction: row">
                <input type="text" placeholder=" 请输入验证码" v-model="cphone.code" v-validate="'required'" name="验证码" style="width: 122px;height:40px;color: #606266;border-radius: 4px;padding-right: 30px;border: 1px solid #DCDFE6;" />
                <input class="btn btn-primary" @click="getyzcode" value=" 获取短信验证码" style="width: 142px;cursor: pointer;margin:0px 0px 0px 6px;padding:0px"/>
              </div>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('验证码') }}</span>
            </el-form-item>
            <el-form-item label="手机号" label-width="160px">
              <el-input type="text" v-model="cphone.new_phone" placeholder="请输入新手机号" name="mobile" data-vv-name="mobile" v-validate="'required|mobile'" clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('mobile') }}</span>
            </el-form-item>
          </el-form>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" style="background-color:#3C7EEE;width:120px;border:none;" @click="userphonechangeflag = false;changephone()">确 定</el-button>
            <el-button @click="userphonechangeflag = false;cphone.code='';cphone.new_phone=''" style="background-color:#cccccc;color:#ffffff;width:120px;">取 消</el-button>
          </div>
        </el-dialog>
      </div>
      <div class="mimachangebox">
        <el-dialog title="修改邮箱" width="600px" :visible.sync="useremailchangeflag" style="border-radius: 4px;" center>
          <div style="display:flex;justify-content:center;flex-direction:column">
          <!-- <div style="width:540px;height: 1px;background-color: #32c5d2;margin-bottom:20px;"></div> -->
          <el-form :model="cemail">
            <el-form-item label="邮箱号" label-width="160px">
              <el-input type="text" v-model="userinfo.email" :disabled="true"  clearable></el-input>
            </el-form-item>
            <el-form-item label="验证码" label-width="160px">
              <div style="display:flex;flex-direction: row">
                <input type="text" placeholder=" 请输入验证码" v-validate="'required'" name="验证码" v-model="cemail.code" style="width: 122px;height:40px;color: #606266;border-radius: 4px;padding-right: 30px;border: 1px solid #DCDFE6;" />
                <input class="btn btn-primary" @click="getemailyzcode" value=" 获取邮箱验证码" style="width: 142px;cursor: pointer;margin:0px 0px 0px 6px;padding:0px"/>
              </div>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('验证码') }}</span>
            </el-form-item>
            <el-form-item label="邮箱号" label-width="160px">
              <el-input type="text" v-model="cemail.new_email" placeholder="请输入新邮箱号" v-validate="'required|email'" name="邮箱"  clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('邮箱') }}</span>
            </el-form-item>
          </el-form>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" style="background-color:#3C7EEE;width:120px;border:none;" @click="useremailchangeflag = false;changeemail()">确 定</el-button>
            <el-button @click="useremailchangeflag = false;cemail.code='';cemail.new_email=''" style="background-color:#cccccc;color:#ffffff;width:120px;">取 消</el-button>
          </div>
        </el-dialog>
      </div>
      <div class="mimachangebox">
        <el-dialog title="添加邮箱" width="600px" :visible.sync="useremailaddflag" style="border-radius: 4px;" center>
          <div style="display:flex;justify-content:center;flex-direction:column">
          <!-- <div style="width:540px;height: 1px;background-color: #32c5d2;margin-bottom:20px;"></div> -->
          <el-form :model="addemail">
            <el-form-item label="邮箱号" label-width="160px">
              <el-input type="text" v-model="addemail.new_email" placeholder="请输入新邮箱号" v-validate="'required|email'" name="邮箱"  clearable></el-input>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('邮箱') }}</span>
            </el-form-item>
            <el-form-item label="验证码" label-width="160px">
              <div style="display:flex;flex-direction: row">
                <input type="text" placeholder=" 请输入验证码" v-validate="'required'" name="验证码" v-model="addemail.code" style="width: 122px;height:40px;color: #606266;border-radius: 4px;padding-right: 30px;border: 1px solid #DCDFE6;" />
                <input class="btn btn-primary" @click="getemailyzcode" value=" 获取邮箱验证码" style="width: 142px;cursor: pointer;margin:0px 0px 0px 6px;padding:0px"/>
              </div>
              <span class="help is-danger" style="color:red;font-size:15px;">{{ errors.first('验证码') }}</span>
            </el-form-item>
          </el-form>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button type="primary" style="background-color:#3C7EEE;width:120px;border:none;" @click="useremailaddflag = false;addemailf()">确 定</el-button>
            <el-button @click="useremailaddflag = false;addemail.code='';addemail.new_email=''" style="background-color:#cccccc;color:#ffffff;width:120px;">取 消</el-button>
          </div>
        </el-dialog>
      </div>
    </div>
    </div>
  </div>
</template>

<script>
import {messages} from '../../validate/reg'
import moment from "moment"
export default {
  data(){
    return{
      addemail:{
        code:'',
        new_email:''
      },
      cemail:{
        code:'',
        new_email:''
      },
      userid:'',
      SessionToken:'',
      keyword: "",
      userinfo:'',
      // 左下目录
      menuflag: 1,
      content1nav:1,
      imageUrl:'',
      // 用户名修改
      username: '',
      usernamechangeflag:0,
      usernamechange:0,
      // 邮箱修改
      email: '',
      useremailaddflag:false,
      emailchangeflag:0,
      emailchange:0,
      userphonechangeflag:false,
      userphonechange:0,
      cphone:{
        code:'',
        new_phone:''
      },
      phonemimachangeflage:false,
      emailmimachangeflage:false,
      form:{
        password:'',
        password2:'',
        phone:'',
        code:''
      },
      cpass:{
        email:'',
        password2:'',
        phone:'',
        code:''
      },
      StrategyList:[],
      ArticleList:[],
      emailcode:'',
      // 点赞列表
      LikeList:[],
      interval:'',
      countdown:60,
      useremailchange:0,
      useremailchangeflag:false,
      permission:'',
      selectionStrategyData:'',
    }
  },
  mounted(){
    this.getselectionStrategyData()
    if(localStorage.getItem('permission') != null){
      this.permission = localStorage.getItem('permission').split(",")
    }
    this.userid=localStorage.getItem('Userid'),
    this.SessionToken=localStorage.getItem('SessionToken')
    this.getusername()
    this.getStrategyList()
    this.getArticleList()
    this.getLikeList()
    this.$validator.localize('zh_CN', messages);
        this.$validator.extend('mobile', {
            getMessage: field => '手机号有误',
            validate: value => {
            return /^((13|14|15|17|18)[0-9]{1}\d{8})$/.test(value)
            }
        })
  },
  methods:{
    deletearticle(id){
      this.$http.post('article/deleteArticleById?id='+id+'&sessionToken='+this.SessionToken+'').then((resp) => {
        if (resp.data.status === 200) {
          this.$message.success('删除成功！')
          this.getArticleList()
        } else {
          this.$message(resp.data.msg)
        }
      })
    },
    getselectionStrategyData(){
      this.$http.get('rank/square?strategyName=&pageSize=6&pageIndex=1').then((resp) => {
        if (resp.data.status === 200) {
          console.log(resp.data)
          this.selectionStrategyData = resp.data.data.list
          for(let i = 0;i<this.selectionStrategyData.length;i++){
            this.selectionStrategyData[i].rank = (i+1)+6*(resp.data.data.pageNum-1)
              this.selectionStrategyData[i].testrecord.starttime = moment(new Date(parseInt(this.selectionStrategyData[i].testrecord.starttime))).format("YYYY-MM-DD")
              this.selectionStrategyData[i].testrecord.endtime = moment(new Date(parseInt(this.selectionStrategyData[i].testrecord.endtime))).format("YYYY-MM-DD")
              // if(this.selectionStrategyData[i].userInfo.head === null){
              //   this.selectionStrategyData[i].userInfo.head = './../../../static/image/默认头像.jpg'
              // }
          }
          console
        } else {
          this.$message(resp.data.msg)
        }
      })
    },
    gotoArticle(id){
      localStorage.setItem('communityid', id)
      this.$router.push('/community_detail')
      this.$http.post('article/updateArticleReadingVolume?id='+id+'').then((resp) => {
        if (resp.data.status === 200) {
          console.log(resp.data)
        }else if(resp.data.status === 499){
              this.$message.error('当前用户没有该权限！')
            } else {
          console.log(resp.data)
        }
      })
    },
    // 获取我的点赞
    getLikeList(){
      this.$http.get('vote/listVotesByUserId?sessionToken='+this.SessionToken+'').then((resp) => {
        if (resp.data.status === 200) {
          console.log(resp.data)
          this.LikeList = resp.data.data
          for(let i = 0;i<this.LikeList.length;i++){
            this.LikeList[i].create_time = moment(new Date(parseInt(this.LikeList[i].create_time))).format("YYYY-MM-DD hh:mm:ss")
          }
        }else if(resp.data.status === 499){
              this.$message.error('当前用户没有该权限！')
            } else {
          // this.$message(resp.data.msg)
          console.log(resp.data)
        }
      })
    },
    // 获取验证码
    getyzcode () {
      if(this.cphone.phone !== ''){
        this.$http.get('smsRegister?phone='+this.cphone.phone+'').then((resp) => {
          if (resp.data.status === 200) {
            this.$message.success("验证码已发送到手机")
          }else if(resp.data.status === 499){
              this.$message.error('当前用户没有该权限！')
            } else {
            this.$message.error('发送验证码错误')
          }
        })
      } else{
        this.$message.error('请输入正确手机号！')
      }
    },
    // 修改手机号
    changephone(){
      if(this.cphone.phone !== '' && this.cphone.code !== '' && this.cphone.new_phone !== ''){
        this.$http.get('selectPhoneIsExisted?phone='+this.cphone.new_phone+'').then((resp) => {
          if (resp.data.status === 200) {
            this.$http.post('changePhone?sessionToken='+this.SessionToken+'&phone='+this.cphone.phone+'&code='+this.cphone.code+'&new_phone='+this.cphone.new_phone+'').then((resp) => {
              if (resp.data.status === 200) {
                this.$message.success('修改手机号成功！')
                this.getusername()
              }else if(resp.data.status === 499){
                this.$message.error('当前用户没有该权限！')
              } else {
                this.$message.error('修改手机号失败！')
              }
            })
          } else {
            this.$message.error(resp.data.message)
          }
        })
      }else {
        this.$message.error("请输入完整信息")
      }
    },
    addemailf(){
      this.emailchangeflag = 0
      if(this.addemail.code === this.emailcode){
        if(this.addemail.new_email !== ''){
          this.$http.post('changeEmail?sessionToken='+this.SessionToken+'&email='+this.addemail.new_email+'').then((resp) => {
            if (resp.data.status === 200) {
              this.$message.success('修改邮箱成功！')
              this.getusername()
            }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
              this.$message.error('修改邮箱失败！')
            }
          })
        }else{
          this.$message.error('修改邮箱不能为空！')
        }
      } else {
        this.$message.error('请填写正确的验证码！')
      }
    },
    // 修改邮箱
    changeemail(){
      this.emailchangeflag = 0
      if(this.cemail.code === this.emailcode){
        if(this.cemail.new_email !== ''){
          this.$http.post('changeEmail?sessionToken='+this.SessionToken+'&email='+this.cemail.new_email+'').then((resp) => {
            if (resp.data.status === 200) {
              this.$message.success('修改邮箱成功！')
              this.getusername()
            }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
              this.$message.error('修改邮箱失败！')
            }
          })
        }else{
          this.$message.error('修改邮箱不能为空！')
        }
      } else {
        this.$message.error('请填写正确的验证码！')
      }
    },
    // 修改昵称
    changename(){
      this.usernamechangeflag = 0;
      if(this.username !== ''){
        this.$http.post('changeName?sessionToken='+this.SessionToken+'&name='+this.username+'').then((resp) => {
          if (resp.data.status === 200) {
            this.$message.success('修改用户名成功！')
            this.getusername()
          }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
            this.$message.error('修改用户名失败！')
          }
        })
      }else{
        this.$message.error('修改用户名不能为空！')
      }
      
    },
    // 获取手机验证码修改密码
    getphonecode(){
      this.$http.get('smsRegister?phone='+this.userinfo.phone+'').then((resp) => {
        if (resp.data.status === 200) {
          this.$message.success("验证码已发送到手机")
        }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
          this.$message.error('发送验证码错误')
        }
      })
    },
    // 获取邮箱验证码
    getemailyzcode(){
      // console.log(typeof this.countdown)
      if(this.countdown == 60 || this.countdown == 0){
        this.$http.post('getEmail?account='+this.userinfo.account+'').then((resp) => {
          if (resp.data.status === 200) {
            this.emailcode = resp.data.data.yanzhengma
            this.$message.success("验证码已发送到邮箱")
            this.interval = setInterval(() => {
              this.countdown = this.countdown-1
              console.log(this.countdown)
              if (this.countdown == 0) {
                this.countdown =60
                console.log(this.countdown)
                clearInterval(this.interval)
              } else {
                // console.log("" + this.countdown + "秒后重新发送")
              }
            }, 1000)
          }else if(resp.data.status === 499){
            this.$message.error('当前用户没有该权限！')
          } else {
            this.$message.error('发送验证码错误')
          }
        })
      } else{
        this.$message.error("" + this.countdown + "秒后重新发送")
      }
    },
    getaddemailyzcode(){
      // console.log(typeof this.countdown)
      if(this.countdown == 60 || this.countdown == 0){
        this.$http.post('getEmail?account='+this.userinfo.account+'').then((resp) => {
          if (resp.data.status === 200) {
            this.emailcode = resp.data.data.yanzhengma
            this.$message.success("验证码已发送到邮箱")
            this.interval = setInterval(() => {
              this.countdown = this.countdown-1
              console.log(this.countdown)
              if (this.countdown == 0) {
                this.countdown =60
                console.log(this.countdown)
                clearInterval(this.interval)
              } else {
                // console.log("" + this.countdown + "秒后重新发送")
              }
            }, 1000)
          }else if(resp.data.status === 499){
            this.$message.error('当前用户没有该权限！')
          } else {
            this.$message.error('发送验证码错误')
          }
        })
      } else{
        this.$message.error("" + this.countdown + "秒后重新发送")
      }
    },
    // 修改密码
    emailchangemima(){
      console.log(this.emailcode)
      if(this.cpass.code !== '' && this.cpass.password !== '' && this.cpass.password2 !== ''){
        if(this.cpass.code === this.emailcode){
          if(this.cpass.password === this.cpass.password2){
            this.$http.post('upPassword?username='+this.userinfo.account+'&password='+this.cpass.password+'').then((resp) => {
              if (resp.data.status === 200) {
                this.$message.success('修改密码成功！')
                // this.getusername()
                console.log(localStorage)
                localStorage.clear()
                this.$router.push('/login')
              }else if(resp.data.status === 499){
                this.$message.error('当前用户没有该权限！')
              } else {
                this.$message.error('修改密码失败！')
              }
            })
          } else{
            this.$message.error("两遍密码输入不一致！")
          }
        }else{
          this.$message.error("验证码错误！")
        }
      } else {
        this.$message.error("请输入完整信息")
      }
    },
    phonechangemima(){
      if(this.form.code !== '' && this.form.password !== '' && this.form.password2 !== ''){
        if(this.form.password === this.form.password2){
          this.$http.post('changePassword?sessionToken='+this.SessionToken+'&new_Password='+this.form.password+'&code='+this.form.code+'').then((resp) => {
            if (resp.data.status === 200) {
              this.$message.success('修改密码成功！')
              localStorage.clear()
              this.$router.push('/login')
            }else if(resp.data.status === 499){
              this.$message.error('当前用户没有该权限！')
            } else {
              this.$message.error('修改密码失败！')
            }
          })
        } else{
          this.$message.error("两遍密码输入不一致！")
        }
      } else {
        this.$message.error("请输入完整信息")
      }
    },
    // 上传头像限定
    onBeforeUploadImage(file){
      const isIMAGE = file.type === 'image/jpeg' || 'image/jpg' || 'image/png' || 'image/PNG' || 'image/JPG'
      const isLt1M = file.size / 1024 / 1024 < 1
      if (!isIMAGE) {
        this.$message.error('上传文件只能是图片格式!')
      }
      if (!isLt1M) {
        this.$message.error('上传文件大小不能超过 1MB!')
      }
      return isIMAGE && isLt1M
    },
    // 用户头像修改
    upload(param){
      let files = param.file
      console.log(files)
      console.log(typeof files)
      var formData = new FormData()
      formData.append('id', this.userid)
      formData.append('file', files)
      console.log(formData)
      this.$http.post('/Upimg',formData).then((resp) => {
        if (resp.data.status === 200) {
          this.getusername()
        }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
          console.log(resp)
        }
      })
    },
    getusername () {
      // 根据获取的用户名
      this.$http.get('getInformation?id='+this.userid+'').then((resp) => {
        if (resp.data.status === 200) {
          this.userinfo = resp.data.data
          // this.handleAvatarSuccess() ./../../../static/image/默认头像.jpg
          if(this.userinfo.img == null){
            this.imageUrl = './../../../static/image/默认头像.jpg'
          } else {
            this.imageUrl = this.userinfo.img
          }
        }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
          console.log('获取用户信息失败')
        }
      })
    },
    // handleAvatarSuccess(res, file) {
    //   this.imageUrl = URL.createObjectURL(file.raw);
    //   console.log(imageUrl)
    //   console.log(res)
    // },
    // 获取用户策略列表
    getStrategyList () {
      this.$http.post('inquireByName?sessionToken='+this.SessionToken+'&keyword=&pageIndex=1&pageSize=999').then((resp) => {
        if (resp.data.status === 200) {
          this.StrategyList = resp.data.data.list
          for(let i = 0;i<this.StrategyList.length;i++){
              this.StrategyList[i].createtime = moment(new Date(parseInt(this.StrategyList[i].createtime))).format("YYYY-MM-DD hh:mm:ss")
              this.StrategyList[i].uploadtime = moment(new Date(parseInt(this.StrategyList[i].uploadtime))).format("YYYY-MM-DD hh:mm:ss")
          }
          console.log(this.StrategyList)
        }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
          this.$message.error('获取策略列表失败！')
        }
      })
    },
    strategydetail(id){
      localStorage.setItem('strategyId',id)
      this.$router.push('/strategy_create')
    },
    //获取我的文章列表
    getArticleList(){
      this.$http.get('article/listArticlesByUserId?sessionToken='+this.SessionToken+'').then((resp) => {
        if (resp.data.status === 200) {
          this.ArticleList = resp.data.data
          console.log(this.ArticleList)
          for(let i = 0;i<this.ArticleList.length;i++){
            this.ArticleList[i].createTime = moment(new Date(parseInt(this.ArticleList[i].createTime))).format("YYYY-MM-DD hh:mm:ss")
          }
        }else if(resp.data.status === 499){
          this.$message.error('当前用户没有该权限！')
        } else {
          this.$message.error('获取文章列表失败！')
        }
      })
    },
    
  }
}
</script>